package com.attendance.chdingtask.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 厂区进出口位置
 */

@AllArgsConstructor
@NoArgsConstructor
@Builder
@Entity
@Data
@Table(name="md_area")
@JsonIgnoreProperties(value = {"hibernateLazyInitializer", "handler"})
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
@ApiModel(description = "厂区进出口位置表")
@EntityListeners(AuditingEntityListener.class)
public class MdArea implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 主键
     */
    @Id
    @GeneratedValue(strategy= GenerationType.IDENTITY)
    @ApiModelProperty(value = "主键")
    private  Long id;



    @ApiModelProperty(value = "排序")
    private Long orderNo;

    /**
     *  区域名称 ：  生产区-0；生活区-1；维护基地-2；
     */
    @ApiModelProperty(value = "区域名称")
    private String areaName;

    private String corpId;


    /**
     *  上青矿，井下矿
     */
    @ApiModelProperty(value = "地域标签")
    private String areaType;

    /**
     * 删除标志
     */
    private Integer dr = Integer.valueOf(0);

    @CreatedDate
    @Column(name = "create_time")
    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @LastModifiedDate
    @Column(name = "modify_time")
    @ApiModelProperty(value = "修改时间")
    private Date modifyTime;

    @Transient
    @ApiModelProperty(value="进井人数")
    private Integer enterCount;

    @Transient
    @ApiModelProperty(value="出井人数")
    private Integer outCount;

    @Transient
    @ApiModelProperty(value="剩余人数")
    private Integer residueCount;

    @Transient
    @ApiModelProperty(value="设备详情")
    private List<MdDevice> deviceList;

}
